package HouseTest.Ui;

import HouseTest.Service.HouseService;

import java.io.IOException;


public class HouseView {
    public static void mainMenu() throws IOException {
        HouseService hs = new HouseService();
        while (true) {
            System.out.println("---------------------房屋出租系统---------------------");
            System.out.println("\t\t\t1 新增房源\t\t\t");
            System.out.println("\t\t\t2 查找房源\t\t\t");
            System.out.println("\t\t\t3 删除房源\t\t\t");
            System.out.println("\t\t\t4 修改房屋信息\t\t\t");
            System.out.println("\t\t\t5 房屋列表\t\t\t");
            System.out.println("\t\t\t6 退出\t\t\t");
            System.out.println("请输入要执行的操作: ");
            char a = HouseTest.Utility.readMenuSelection();
            switch (a) {
                case '1':
                    hs.addHouse();
                    break;
                case '2':
                    hs.findHouse();
                    break;
                case '3':
                    hs.deleteHouse();
                    break;
                case '4':
                    hs.changeHouse();
                    break;
                case '5':
                    hs.listHouse();
                    break;
                case '6':
                    return;
            }
        }
    }
}
